<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>退费管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="退费,管理">
	<meta http-equiv="description" content="This is my page">

	<script type="text/javascript" src="${CONTEXT_PATH}/common/js/divTip.js"></script>
	<script src='${CONTEXT_PATH}/dwr/interface/listTipService.js'></script>
	<script src='${CONTEXT_PATH}/dwr/engine.js'></script>
	<script src='${CONTEXT_PATH}/dwr/util.js'></script>

  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="refundManage.action" namespace="/inner/charge">
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'退费管理'},{'name':'交费情况'}]"/>
    			<jsp:param name="width" value="40%"/>
    		</jsp:include>
    		
    		<s:hidden name="kindergartenId" id="kindergartenId"></s:hidden>
    		
    		<table cellspacing="1" width="100%" bgcolor="#CCCCCC">
				<tr bgcolor="#FFFFFF">
					<td align="right" width="10%" class="label">
						学童编号：
					</td>
					<td align="left" width="23%">
						<s:textfield name="rvo.childNum" id="childNum" cssStyle="width:80%" cssClass="search"></s:textfield>
					</td>
					<td align="right" width="10%" class="label">
						学童姓名：
					</td>
					<td align="left" width="23%">
						<s:textfield name="rvo.childName" id="childName" cssStyle="width:80%" cssClass="search"></s:textfield>
					</td>
					<td align="right" width="10%" class="label">
						退费日期：
					</td>
					<td align="left" width="24%">
						<s:textfield name="rvo.refundDateStart" id="refundDateStart" cssStyle="width:100px" cssClass="WDate search" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"></s:textfield>
						-
						<s:textfield name="rvo.refundDateEnd" id="refundDateEnd" cssStyle="width:100px" cssClass="WDate search" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"></s:textfield>
					</td>
				</tr>
				<tr bgcolor="#FFFFFF">
					<td align="right" class="label">
						备注：
					</td>
					<td align="left">
						<s:textfield name="rvo.refund.remark" id="remark" cssStyle="width:80%" cssClass="search"></s:textfield>
					</td>
					<td colspan="4"></td>
				</tr>
			</table>
    		
    		<table cellspacing="0" width="100%">
				<tr>
					<td align="left">
						<input type="button" value="查询" class="btn" onclick="searchThis()"/>
						<my:hasPermission privilegeId="toAddRefund">
						<input type="button" value="新增" class="btn" onclick="addRefund()"/>
						</my:hasPermission>
						<input type="button" value="重置" class="btn" onclick="resetSearch()"/>
					</td>
				</tr>
			</table>
    		<table width="100%" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC">
    			<tr class="tableHead" align="center">
    				<td width="8%">
    					序号
    				</td>
    				<td width="16%">
    					学童编号
    				</td>
    				<td width="16%">
    					学童姓名
    				</td>
    				<td width="17%">
    					退费日期
    				</td>
    				<td width="26%">
    					备注
    				</td>
    				<td width="17%">
    					操作
    				</td>
    			</tr>
    			<s:iterator value="lp.list" status="s">
    				<tr align="center"
    					<s:if test="#s.index%2==0">class="tableRow2" onMouseMove="this.className='tableRow3'" onMouseOut="this.className='tableRow2'"</s:if>
						<s:else>class="tableRow1" onMouseMove="this.className='tableRow3'" onMouseOut="this.className='tableRow1'"</s:else>
    				>
    					<td>
    						<s:property value="(pager.thisPage - 1) * pager.pageSize + #s.index + 1" />
    					</td>
    					<td>
    						<s:property value="childNum"/>
    					</td>
    					<td>
    						<s:property value="childName"/>
    					</td>
    					<td>
    						<s:date name="refundDate" format="yyyy-MM-dd"/>
    					</td>
    					<td>
    						<s:property value="remark"/>
    					</td>
    					<td>
    						<a href="javascript:updateRefund('<s:property value="id" />')"><s:property value="operateChn" /></a>
    						<my:hasPermission privilegeId="delRefund">
    						<a href="javascript:delRefund('<s:property value="id" />')">删除</a>
    						</my:hasPermission>
    					</td>
    				</tr>
    			</s:iterator>
    			<jsp:include page="/common/pager/pager.jsp">
					<jsp:param name="formName" value="frm" />
					<jsp:param name="id" value="1" />
				</jsp:include>
    		</table>
    	</s:form>
    </center>
    
    <script type="text/javascript">
    function addRefund()
    {
    	var kgId = getTopKg();
    	var child = selectOneChild(kgId);
    	var url = 'inner/charge/toAddRefund.action?kindergartenId=' + kgId + '&refund.child.id=' + child.id;
    	window.location.href = url;
    }
    
    function updateRefund(id)
    {
    	var url = realPath + '/inner/charge/toUpdateRefund.action?refund.id=' + id;
    	window.location.href = url;
    }
    
    function delRefund(id)
    {
    	showConfirm('确认删除？', function(v){
    		if(v == true)
    		{
    			var url = 'inner/charge/delRefund.action?refund.id=' + id;
    			ajaxAction(url, 'post', 'frm', false, function(){
    				searchThis();
		    	});
    		}
    	});
    }
    
    function searchThis()
    {
    	$('#thisPage').val(1);
    	$('#frm').submit();
    }
    
    </script>
  </body>
</html>
